package com.kly.smartbi.test.day3;

import java.time.LocalDate;
import java.util.Scanner;

/**
 * @author admin
 * @date 2025/4/3
 */
public class demo1 {

    public static void main(String[] args) {
        nineToTen();
    }


    /**
     * 计算次方
     */
    public static void power() {
        long pow = (long)(Math.pow(2, 26));
        long n = (256L * 1024 * 1024 * 8) / 32;
        System.out.println("n = " + n);
        System.out.println("pow = " + pow);
        System.out.println();
    }

    /**
     * 九进制转十进制
     */
    public static void nineToTen() {
        String s = "2022";
        int i = Integer.parseInt(s, 9);
        System.out.println("i = " + i);
    }

    /**
     * 计算日期
     */
    public static void date() {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        LocalDate beginDate = LocalDate.of(2000, 1, 1);
        LocalDate endDate = LocalDate.of(2020, 10, 1);
        int sum = 0;
        while(beginDate.compareTo(endDate) != 0) {
            if(beginDate.getDayOfMonth() == 1 || beginDate.getDayOfWeek().getValue() == 1 ) {
                sum += 2;
            }else {
                sum += 1;
            }
            beginDate = beginDate.plusDays(1);
        }
        System.out.println(sum);
        scan.close();
    }
}
